This graph shows a simple scatter plot graph with random colors and 50 randomly positioned points
import matplotlib.pyplot as plt
import numpy as np
# Fixing random state for reproducibility
np.random.seed(19680801)
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = (30 * np.random.rand(N))**2 # 0 to 15 point radii
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.show()
This graph loads the Iris flower data set and shows the sepal_width and sepal_length on the x and y axis respectively
import plotly
plotly.offline.init_notebook_mode()
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color='petal_length')
fig.show()
This graph shows the signal change over time for different regions and events
import seaborn as sns
sns.set_theme(style="darkgrid")
# Load an example dataset with long-form data
fmri = sns.load_dataset("fmri")
# Plot the responses for different events and regions
sns.lineplot(x="timepoint", y="signal",
hue="region", style="event",
data=fmri)
<Axes: xlabel='timepoint', ylabel='signal'>
Please click this link to my GitHub labs repo
| Student Name | Student ID |
|---|---|
| Hamna Ashraf | 8826836 |
